package com.baizan.daka.widget

import android.widget.TextView
import com.chad.library.adapter.base.BaseViewHolder
import com.chad.library.adapter.base.loadmore.LoadMoreView
import com.dianzan.daka.R

class CustomLoadMoreView : LoadMoreView() {

    private var noMoreString = "已经全部加载完毕"


    override fun getLayoutId(): Int {
        return R.layout.my_brvah_quick_view_load_more
    }

    override fun getLoadingViewId(): Int {
        return R.id.load_more_loading_view
    }

    override fun getLoadFailViewId(): Int {
        return R.id.load_more_load_fail_view
    }

    override fun getLoadEndViewId(): Int {
        return R.id.load_more_load_end_view
    }

    override fun convert(holder: BaseViewHolder) {
        super.convert(holder)
        val mNoMoreTv = holder.getView<TextView>(R.id.no_more_tv)
        mNoMoreTv.text = noMoreString
    }

    fun setNoMoreString(noMoreString: String?): CustomLoadMoreView? {
        this.noMoreString = noMoreString ?: ""
        return this
    }
}